<?php $this->beginContent('//layouts/main'); ?>
<div class="container">
	<div class="span-10 last">
        <div id="sidebar">
            <dl>
                <dt><?php echo (Yii::app()->user->lang!='english')?'目录':'Table of Contents';?> </dt>
                <dd>
                    <?php $this->widget('zii.widgets.CMenu',array(
                    'id'=>'bookmenu',
    		    	'items'=>$this->menu,
                    )); ?>
                </dd>
            </dl>

		</div><!-- sidebar -->
	</div>
	<div class="span-16">
		<div id="content">
        	<?php echo $content; ?>
        </div><!-- content -->
	</div>
</div>
<script type="text/javascript">
function submitForm(obj){
	var content = FCKeditorAPI.GetInstance('Contents[content]').GetXHTML();
	$("#Contents_content").val(content);
	$.ajax({
		'type':'POST',
		'url':'<?php echo CHtml::normalizeUrl(array('books/update')); ?>',
		'cache':false,
		'data':jQuery(obj).parents("form").serialize(),
		'success':function(html){jQuery("#content").html(html)}
	});
}

function updateContents(booksId){
	$.ajax({
		'url':'<?php echo CHtml::normalizeUrl(array('books/update')); ?>&booksId='+booksId,
		'cache':false,
		'success':function(html){
			$("#updateForm").html(html);
			$("#Contents_content").val($("#showForm").html());
			$("#showForm").hide()}
	});
}
function viewContents(contentsId){
	$.ajax({
		'url':'<?php echo CHtml::normalizeUrl(array('books/test')); ?>&contentsId='+contentsId,
		'cache':false,
		'success':function(html){jQuery("#content").html(html)}
	});
}
</script>
<?php $this->endContent(); ?>
